<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Items List</title>
<script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
<link rel="stylesheet" href="../css/bootstrap.min.css">
<style type="text/css">
body {
	padding-top: 50px;
	margin-left: 50px;
	margin-right: 50px;
}

table {
	margin: auto;
}

thead, tfoot {
	background-color: #009900;
}

.even {
	background-color: #CCFFCC !important;
}

.odd {
	background-color: white;
}
</style>
</head>
<body>
	<div class="panel panel-primary">
		<div class="panel panel-heading">Item List</div>
		<div class="panel panel-body">
			<table class="table table-bordered">
				<thead>
					<tr>
						<td>Name</td>
						<td>Description</td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
					</tr>
				</thead>
				<tbody>
					<s:iterator value="items" status="itemStatus">
						<tr
							class='<s:if test="#itemStatus.odd == true">odd</s:if><s:else>even</s:else>'>
							<td><s:property value="name" /></td>
							<td><s:property value="description" /></td>
							<td><a class="btn btn-default"
								href="update?id=<s:property value='id'/>">Update</a></td>
							<td><a class="btn btn-default"
								href="remove?id=<s:property value='id'/>">Delete</a></td>
						</tr>
					</s:iterator>
				</tbody>
				<tfoot>
					<tr>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td><a class="btn btn-default" href="add.jsp">Add</a></td>
						<td>&nbsp;</td>
					</tr>
				</tfoot>
			</table>
		</div>
	</div>
</body>
</html>
